import java.util.HashSet;
import java.util.Set;

/**
 * This is just a holder object for holding the key and value sets of a
 * relation. A relation will be composed of a list of FDs. A
 * FunctionalDependency holds a key and value set. **THIS IS NECESSARY** Also,
 * because of how often I use "allAttribs" that is included in this object.
 * isMultiVal is used to determine if this object has a multivalue dependency in
 * it. If it does, we cannot perform 3nf or BCNF operations on the relation.
 * 
 * 
 * @author Sean Clapp
 * 
 */
public class FunctionalDependency {
	private Set key;
	private Set value;
	private boolean isMultiVal;
	private Set allAttribs;

	public boolean isMultiVal() {
		return isMultiVal;
	}

	public void setMultiVal(boolean isMultiVal) {
		this.isMultiVal = isMultiVal;
	}

	public FunctionalDependency() {
		super();
		// this.fd = new HashMap<AttributeList, AttributeList>();
		this.key = new HashSet();
		this.value = new HashSet();
	}

	public Set getKey() {
		return key;
	}

	public void setKey(Set key) {
		this.key = key;
	}

	public Set getValue() {
		return value;
	}

	public void setValue(Set value) {
		this.value = value;
	}

	public Set getAllAttribs() {
		return allAttribs;
	}

	public void setAllAttribs(Set allAttribs) {
		if (allAttribs.isEmpty()) {
			this.allAttribs = allAttribs;
		} else {
			this.allAttribs.addAll(allAttribs);
		}

	}

}